package com.fh.shop.api.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000121651318";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCXTWYswRxtKO3k96hJF25LZTInC/pwDNe0+UX1kqXhqnnTd/Qxfv+qoTsSxFbvuJ2xQTQi0gHuqxha2FIaVZrRH+1Vn0HB1i6dRyp3QdJ1KhfceALYQQ7ob0ocbxeoZ+giYm18Gmt7t8bgryGqhAtE1/Lz4Voz21aImOfh8O44ol33eLvphG22Tpm0qwopMHQSMf+3Rn1EeY4wXmHuufJke0Os+1tnwAzGE00c9iKxtodLZ9+GcgbpHCHAosO2n3ngCMwZdsCSFLSFp7XNIl9PN2mdUTqtqvAJ9wGGNaNZNvutfTTLPzCzbejc80flextBehV1JitGDhq8f1cOix6tAgMBAAECggEADkNLmHhz145+LpFyGcHNsenOOoQUja+IPhUplSbH4GgTp+2s5WWVcF5WlURQ9bQvmWAOLCIj8H3Mg/PUeYsMVx5tXx7uMfmg1064IBniXw0ixrPBgOVRJHQpRljqoAN7jJI+w+4xp64BX3ji8ZIVBd5dlsPtnunUVHglk9UEf+4Y+tFwu+ik8XmWcyvsD1lVpyevcmLIU/svSvetC5PnNotPdjbKdd7YweXmMD7Yi9tSpMzCvYVEHBM5DAajhRwJcfPD1YK4kjxDBarIuSxC4UYwBaisxD5XtiZghtER3BJFZ2nPqYccswegiT4zLO80ZakMgE7SkoRsOJO6UHXrQQKBgQDiHuqeoN+/rB9F5raNvSAOUbK/MKSg+C/xQgmdA0k9tJ+uj3077POMOAj5QJpRXiKFOcLwlSSpvM4vYsr20LM6pQWHlJuFGoon7sQVPb3qHV1yzdJbLxw3gOK+aKTNat7JKU6l3a6ZCzgFig19wV3GI9H8aEPw1w3imkzah5J05QKBgQCrS5FddKzumCCUKq0pqRW+KLKxO4nMGxSFOPYK+tDOxiEdNxcqJKNJk/rox9iC5duCGvNvTcpFf4nRlE3/oL2l/uDiLTwcBI84jrFOWaYXpf9eqK5s7GdGOxcifwsMP+NIaIjDqegue7F44GrJQ+w3KYfaV0AWvfBxRpTSYKxuKQKBgQDWKX//g9DHYgcwlmY6cnDE/x3ztOeHyejmcKxYOL+KoONIWoC7XB4DpSLiqAxAmo7Jbb6zTB6wYLFL8h7Xiyzlk1xcYCS3+T32uk6e655O+UcDr+rXEBSCgSDARK4qHFkrX2Ms93whWZ3SqUFD5Pui6VQ94qbOmXB+ObQmmZbd/QKBgQCPn67ksz2EWF2InjfO5IzsgmdBn3AsiNAt29LA5ghKN2nwew6bMVkQClmo8FejeWMRtdNDEfB1UTiXV0gG/BnHouuf+NmbjF8hxtL3pMdUsMRr8/c8MQNuqYD+VZNH1BGX1r5FgKLCxsfJWDFxS9g1cEcOVXXRG7UM5WdG9fPd8QKBgDmHecc/CcOLZN8IgsryL/qvF3qBykBNW6wsXdfiB0t7HOl1OrBjyT1hOKb3VzPZlYAqvZojy7jJZFv/ExTZOakpksQnD9fMOs3Zlsdi/xEBQNNHuR4YkRcwROd1OoOWV0SR3DbO2IKwIdnT59HDcIUn/duuhsBIv0wh+2WUVCKt";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlWlcPdsdB446PNtCUOxoDJ9/Zt5jRF9lbUMHsC2esiWN46ioKXeoWxm8AdV9tCXbPR9BImwHSbbZrLXNtuXz3nnyvC3N9yVOuSVjS3C7c4bLkqxDCZbDOAXeBpZdGCY7ATv5kGW9tgKpdIMFjxHQ4TNJM7e+JuQHHgy6P74mv9BSYpUZyuNOUDIKjo/zCcqUf1fBVuryD4+rpWEY9/ABOOmdfuPAAA9HQRPL+sIpWu86E3RDSWjVXv7faAJP6x+BviLDZySFNUf9K3az6M1XYuF6QTODXTpRW8kWPlREL9kjxScpepxJYv8MCsTY/Gr5I11jF0q3LvMciuxrivDtXQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://xik38d.natappfree.cc/api/pay/aliNotifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://xik38d.natappfree.cc/api/pay/aliReturnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 日志存放位置
	public static String log_path = "D:\\";

	// 商家id
    public static String seller_id = "2088621991112093";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

